home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "VB Screen Saver"
- ClientHeight = 1875
- ClientLeft = 1860
- ClientTop = 2085
- ClientWidth = 3990
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 2280
- Icon = SSAVER.FRX:0000
- Left = 1800
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 125
- ScaleMode = 3 'Pixel
- ScaleWidth = 266
- Top = 1740
- Width = 4110
- Begin CommandButton Command2
- Caption = "Exit"
- Height = 495
- Left = 2160
- TabIndex = 3
- Top = 1080
- Width = 1215
- End
- Begin CommandButton Command1
- Caption = "Ok"
- Default = -1 'True
- Height = 495
- Left = 480
- TabIndex = 2
- Top = 1080
- Width = 1215
- End
- Begin TextBox Text1
- Height = 375
- Left = 2280
- TabIndex = 1
- Top = 360
- Width = 735
- End
- Begin Timer Timer1
- Interval = 1000
- Left = 120
- Top = 120
- End
- Begin Label Label1
- Caption = "Seconds:"
- Height = 255
- Left = 1080
- TabIndex = 0
- Top = 480
- Width = 855
- End
- DefInt A-Z
- Declare Function RegisterSSaver Lib "ssave.dll" (ByVal hWnd, ByVal VKCode)
- Declare Sub UnRegisterSSaver Lib "ssave.dll" (ByVal hWnd)
- Dim Saving, SecondsLeft, Seconds2Wait, Resizing
- Sub Command1_Click ()
- Seconds2Wait = Val(Text1.Text)
- SecondsLeft = Seconds2Wait
- WindowState = 1
- ShowTime
- End Sub
- Sub Command2_Click ()
- Unload Form1
- End Sub
- Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
- If Resizing Then
- Resizing = False
- Exit Sub
- End If
- If KeyCode = 301 Then
- SecondsLeft = Seconds2Wait
- If Saving Then
- RestoreScreen
- ShowTime
- Saving = False
- End If
- End If
- End Sub
- Sub Form_Load ()
- WindowState = 1
- Caption = "ScrnSave - " + Format$(Now, "m/d")
- If RegisterSSaver(hWnd, 301) Then
- Saving = False
- Seconds2Wait = 60 '1 minute
- SecondsLeft = Seconds2Wait
- Else
- MsgBox "Unable to install!"
- Unload Form1
- End If
- End Sub
- Sub Form_Unload (Cancel As Integer)
- Unload Palette
- UnRegisterSSaver hWnd
- End
- End Sub
- Sub RestoreScreen ()
- Palette.Visible = False
- Timer1.Enabled = True
- End Sub
- Sub SaveScreen ()
- Timer1.Enabled = False
- Resizing = True
- Palette.Show
- End Sub
- Sub ShowTime ()
- Refresh
- If WindowState = 1 Then
- Capt$ = Format$(Now, "HH:MM")
- CurrentX = 5
- CurrentY = 11
- Print Capt$
- End If
- End Sub
- Sub Timer1_Timer ()
- Static Ticks
- SecondsLeft = SecondsLeft - 1
- If (SecondsLeft < 1) And (Saving = False) Then
- 'Start Screen saving here!
- Saving = True
- SaveScreen
- Else
- Ticks = Ticks + 1
- If Ticks > 20 Then
- ShowTime
- Ticks = 0
- End If
- End If
- End Sub
-